package adfc2.core;

/**
 * Created by IntelliJ IDEA.
 * User: aimozg
 * Date: 29.01.12
 * Time: 3:32
 */
public enum Material {
    NONE, GENERIC_SOIL, GRANITE, HEMATITE, OAK_TREE, IRON;
    private static final String[] names;

    static {
        names = new String[values().length];
        names[NONE.ordinal()] = "nothing";
        names[GENERIC_SOIL.ordinal()] = "generic soil";
        names[GRANITE.ordinal()] = "granite";
        names[HEMATITE.ordinal()] = "hematite";
        names[OAK_TREE.ordinal()] = "oak tree";
        names[IRON.ordinal()] = "iron";
        assert names[names.length - 1] != null;
    }

    public static Material get(int ord) {
        return values()[ord];
    }

    public short ord() {
        return (short) ordinal();
    }

    public String shortName() {
        return names[ordinal()];
    }
}
